#define _CRT_SECURE_NO_WARNINGS 1

struct ListNode* FindKthToTail(struct ListNode* pListHead, int k) {
    // write code here


    if (pListHead == NULL)
    {
        return NULL;
    }
    struct ListNode* slow, * fast;
    slow = fast = pListHead;
    while (k--)
    {
        if (fast == NULL)
        {
            return 0;
        }
        fast = fast->next;
    }

    while (fast)
    {
        fast = fast->next;
        slow = slow->next;
    }
    return slow;
}